package com.example.usage.ioc;

import com.example.usage.ioc.bean.car.Car;
import com.example.usage.ioc.bean.student.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jiangzhe
 * @create 2021/9/2 14:22
 */
@RestController
@RequestMapping("/ioc")
public class MyController {
    @Autowired
    Student student;

    @Autowired
    Car car;

    @GetMapping("/student")
    public Student getStudent(){
        return student;
    }

    @GetMapping("/car")
    public Car getCar(){
        return car;
    }
}
